create table javabox_qna_board(
 no number primary key,
 title varchar2(50) not null,
 content varchar2(4000) not null,
 writedate date,
 count number not null,
 category varchar2(50),
 id varchar2(50) not null,
 adopt number not null,
 constraint fk_qa_id foreign key(id) references javabox_member(id)
)
drop table javabox_qna_board;

create sequence javabox_qna_board_no;
drop sequence javabox_qna_board_no;

insert into JAVABOX_QNA_BOARD 
values(javabox_qna_board_no.nextval,'홍홍홍','지금 부터 랩을',sysdate,0,null,'java');

insert into JAVABOX_QNA_BOARD(no,title,content,writedate,count,category,id) 
		values(#{no},#{title},#{content},sysdate,0,'null','java')

select no, title, content, to_char(writedate, 'yyyy/MM/DD'), count, category, id from javabox_qna_board;

select no, title, content, to_char(writedate, 'yyyy/MM/DD') as writedate, count, id 
from javabox_qna_board;

select * from JAVABOX_QNA_BOARD;

delete from javabox_qna_board where no=141;
SELECT no,title,count,id,writedate 
					    FROM(	 
								SELECT no,title,count,id,writedate ,CEIL(rownum/5) AS page  
								FROM ( 
									SELECT no,title,count,id,to_char(writedate,'YYYY.MM.DD') as writedate 
									FROM javabox_qna_board order by no desc								
									 ) 
    ) WHERE PAGE=2;
    
    SELECT no,title,count,id,writedate 
					    FROM(	 
								SELECT no,title,count,id,writedate ,CEIL(rownum/5) AS page  
								FROM ( 
									SELECT no,title,count,id,to_char(writedate,'YYYY.MM.DD') as writedate 
									FROM javabox_qna_board order by no desc								
									 ) 
    ) WHERE PAGE=1 and title like '%12%';
    
    
    
    SELECT no,title,count,id,writedate 
					    FROM(	 
								SELECT no,title,count,id,writedate ,CEIL(rownum/5) AS page  
								FROM ( 
									SELECT no,title,count,id,to_char(writedate,'YYYY.MM.DD') as writedate 
									FROM javabox_qna_board where title like '%12%' order by no desc 							
									 ) 
    ) WHERE PAGE=1;
    
    insert into JAVABOX_QNA_BOARD(no,title,content,writedate,count,id,adopt) 
		values(150,'sdf','asdgasg',sysdate,0,#{memberVO.id}),0)
		
update javabox_qna_board set adopt=1 where bno=7;

select no, title, content, to_char(writedate, 'yyyy/MM/DD') as writedate, count, id,adopt 
from javabox_qna_board;

update javabox_member set point=point-50 where id='java';

select * from JAVABOX_MEMBER;